<?
    /* -*- Mode: PHP5; tab-width: 4; indent-tabs-mode: nil; basic-offset: 4 -*- */
    
    /*********************************************************
    *            --== itellico Net Architect ==--
    *
    * @author Kulikov Alexey <a.kulikov@gmail.com>
    * @version n/a
    * @since 15.08.2005
    * @copyright itellico.com 2005
    *
    *********************************************************/
    
    /***
    * Abstract Class installNodeInserat
    ****
    * This is the module installer/deinstaller, shall
    * automate integration of new modules into client
    * solutions
    ****
    * @package installNodes
    * @author A Kulikov <a.kulikov@gmail.com>
    * @version n/a
    * @since 15.08.2005
    * @copyright itellico.com 2005
    ***/
    class installNodeIsearchitem extends installNode{
        
        /**
         * This is the node install script
         *
         */
        protected function create(){
            //create database table  
            $this->db->Execute("CREATE TABLE node_inserat(
                                    id          SERIAL,
                                    title       VARCHAR(255) NOT NULL,
                                    content     TEXT NOT NULL,
                                    owner_mail  VARCHAR(255) NOT NULL,
                                    owner_code  VARCHAR(255) NOT NULL,
                                    image BOOL  DEFAULT FALSE,
                                    ins_type    SMALLINT NOT NULL DEFAULT 1,
                                    price_type  SMALLINT NOT NULL DEFAULT 0,
                                    price       INTEGER NOT NULL DEFAULT 0,
                                    confirmed   BOOLEAN DEFAULT FALSE,
                                    zip         INTEGER,
                                    PRIMARY KEY(id)
                                )");
        }
        
        
        /**
         * This is the node uninstall script
         *
         */
        protected function remove(){
            //drop database table
            $this->db->Execute("DROP TABLE node_inserat");
        }
        
        
        /**
         * Sets the properties of this node
         *
         */
        protected function setProps(){
            $this->setDescription('ISearch Item');   
            $this->setAdminAdd(false);
        }
    }
?>